<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="lib/vue.global.js"></script>
</head>
<body>
  <div id="root">
    <!-- <my-title :titleText="title"></my-title> -->
    <my-title :title-text="title"></my-title>
    <my-title></my-title>
  </div>
</body>
<script>
  /**
   * vue的自定义的属性名不建议写为驼峰式命名，否则显示属性的默认值
   * 建议写为短横线方式，定义可以使用 驼峰式和短横线, 调用时得使用驼峰式
   * */
  const { createApp } = window.Vue
  const myTitle = {
    // props: ['titleText'],
    // props: {
    //   titleText: String
    // },
    // props: {
    //   titleText: {
    //     type: String,
    //     default: '10000'
    //   }
    // },
    props: {
      'title-text': {
        type: String,
        default: '10000'
      }
    },
    template: `<h1>hello- {{ titleText }}</h1>`
  }
  const app = createApp({
    components: {
      myTitle
    },
    data () {
      return {
        title: '标题'
      }
    }
  })
  const vm = app.mount('#root')
</script>
</html>